import Vue from "vue"

//全局混入
Vue.mixin({
	methods: {
		hasAuth(perm) {
			return this.$store.state.menu.authList.includes(perm);
		},
    setTabs(code,query){
      let data = {}
      this.$store.state.menu.menuList.map(item => {
        if(item.children)item.children.map(items => {
          if(items.code == code)data=items
        })
        else if(item.code == code) data = item
      })
      console.log(query)
      console.log(data)
      this.$router.push({path:data.path,query:query})
      this.$store.commit("setTabs", {
        title: data.menuName,
        name: data.path
      })
    }
	}
})
